<template>
  <div class="index">
    <el-container style="height:100vh; border: 1px solid #eee">
      <el-aside width="200px" style="background-color:#40586d; color:#a9b0c2; height=100%">
        <!-- 侧边头像开始 -->
        <!-- <div class="sub-title">circle</div> -->
        <div class="demo-basic--circle">
          <div class="block" style="text-align:center; margin:50px auto 20px;">
            <el-avatar :size="70" :src="circleUrl"></el-avatar>
          </div>
          <div>
            <p style="text-align:center; font-size:16px; margin-bottom:30px">Coder</p>
          </div>
        </div>
        <!-- 侧边头像结束 -->

        <!-- 侧边导航栏开始 -->
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#40586d"
          text-color="#a9b0c2"
          active-text-color="#ffd04b"
        >
          <router-link to="/">
            <el-menu-item index="1">
              <i class="iconfont icon-ziyuan"></i>
              <span slot="title" style="margin-left:8px">仪表盘</span>
            </el-menu-item>
          </router-link>
          <el-submenu index="2">
            <template slot="title">
              <i class="iconfont icon-wenzhang-copy"></i>
              <span style="margin-left:10px">文章</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1">所有文章</el-menu-item>
              <router-link to="/addNewPost">
                <el-menu-item index="2-2">写文章</el-menu-item>
              </router-link>
              <el-menu-item index="2-3">分类目录</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="3">
            <i class="iconfont icon-pinglun"></i>
            <span slot="title" style="margin-left:10px">评论</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="iconfont icon-yonghu1"></i>
            <span slot="title" style="margin-left:10px">用户</span>
          </el-menu-item>

          <el-submenu index="5">
            <template slot="title">
              <i class="iconfont icon-shezhi"></i>
              <span style="margin-left:10px">设置</span>
            </template>
            <el-menu-item-group>
              <router-link to="/slide">
                <el-menu-item index="5-1">图片轮播</el-menu-item>
              </router-link>
              <router-link to="/setting">
                <el-menu-item index="5-2">网站设置</el-menu-item>
              </router-link>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
        <!-- 侧边导航栏结束 -->
      </el-aside>

      <el-container>
        <!-- header开始 -->
        <el-header style="text-align: right; font-size: 14px; color: #40586d;">
          <router-link to="/passwordReset">
            <i class="iconfont icon-xiugaimima" style="margin-right: 5px;"></i>
            <span style="margin-right: 20px;">修改密码</span>
          </router-link>
          <i id="iconBcak" class="iconfont icon-fanhuiyou" style="margin-right: 5px"></i>
          <span>退出</span>
        </el-header>
        <!-- header结束 -->
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script >
export default {
  data() {
    const item = {
      date: "2016-05-02",
      name: "王小虎",
      address: "上海市普陀区金沙江路 1518 弄",
    };
    return {
      tableData: Array(20).fill(item),
      circleUrl:
        "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
      squareUrl:
        "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
      sizeList: ["large", "medium", "small"],
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style lang="scss" scoped>
.index a {
  text-decoration: none;
}
.index a:visited {
  color: #40586d;
}
.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
  .el-menu {
    border-right: none;
  }
}

#iconUser {
  margin-top: 20px;
}
</style>


